package com.yang.security.utils;

import java.util.Collection;
import java.util.Objects;


/**
 * Created by baipan
 * Date: 2019-12-18
 * Stream 工具类
 */
public class StreamUtils {


    /**
     * stream2Array
     */
    public static String[] streamToArray(Collection<String> collection) {
        if (Objects.isNull(collection) || collection.isEmpty()) {
            return new String[0];
        }
        return collection.toArray(new String[0]);
    }



}
